package cn.democpp.controller;

import cn.democpp.pojo.User;
import cn.democpp.service.UserService;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import javax.annotation.Resource;
import java.util.List;

@Controller("userController")
public class UserController {
    @Resource(name = "userService")
    private UserService userService;

    @RequestMapping(path = {"","/list"},method = RequestMethod.GET)
    public String findAllUserList(Model model){
        List<User> allUser = userService.findAllUser();
        model.addAttribute("userList",allUser);
        return "list";
    }



}
